package com.star.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.star.model.PlModel;

public interface PlDao {

	@Select("select * from t_pl where newsId=#{newsId}")
	public PlModel queryByNewsId(@Param("newsId") Integer newsId);

	@Insert("insert into t_pl (newsId,plrs,xhrs,gmt_create,gmt_modified) values (#{newsId},#{plrs},#{xhrs},now(),now())")
	public void insertPl(PlModel pl);

	@Update("update t_pl set plrs = plrs+1 where id= #{id}")
	public void updatePlRs(Integer id);
	
	@Update("update t_pl set xhrs = xhrs+1 where id= #{id}")
	public void updateXhRs(Integer id);
}
